<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta charset="UTF-8">
    <title>点单8090</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="css/order_List.css">
    <script type="text/javascript" src="lib/js/evm.js"></script>
    <script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="lib/js/key.js"></script>
    <script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/model.js"></script>
    <style>

    </style>
</head>

<body>
    <div class="theoretical-bg">
        <h3>新思想实践宣讲</h3>
        <div class="backcolor"></div>
        <div class="orderlist">

        </div>
    </div>
</body>
<script>
    var modelIndex = {
        disUser: true,
        specialState: 'didi',
        index: 2, //初始位置
        listName: 'model', //模块名称
        containerId: 'theoreticalMain', //包含模块的标签id
        thisContain: 'container', //翻滚外容器
        thisDetail: 'content', //翻滚内容
    }
    var articleRun;

    function getMessage() {
        var param = {
            order_id: TV.GetParam('order_id'),
        }
        GetDatas('orderDetail', param, function(err, res) {
            mess = res.data.order;
            console.log(mess.title, 'mess');
            console.log(TV.GetParam('id'));
            // $('.titleBox').html(mess.title);
            // $("#likes p").html(mess.likes)
            // $('.endtime').html(" <div class=orange>结束时间</div>: " + mess.format_end_time);
            // $('.starttime').html("<img src=" + 'images/time.png' + '>' + " <div class=orange>活动时间</div>: " + mess.format_start_time + ' 至 ' + mess
            // .format_end_time);
            $('.orderlist').append("<h4 class=brief>新思想实践宣讲（" + mess.title + ")</h4>");
            $('.orderlist').append("<span>点单类别</span><div class=content>" + mess.tpe_name + "</div>");
            $('.orderlist').append("<span>宣讲团队</span><div class=organization>" + mess.team + "</div>");
            $('.orderlist').append("<span class=w3>联系人</span><div class=contacts>" + mess.contracter + "</div>");
            $('.orderlist').append("<span>联系方式</span><div class=phone>" + mess.mobile + "</div>");
            // $('.address').html("<img src=" + 'images/address.png' + '>' + '<div class=orange>活动地点</div>：' + mess.address);
            // $('.serviceTime').html("<img src=" + 'images/time.png' + '>' + '<div class=orange>服务时长</div>：' + mess.service_time);
            // $(".data_time").html(mess.format_add_time);
            // $(".click_count").html(mess.click_count);
            // $('.imgs').attr('src', API_URL.imgURL + mess.img);
            // var surl = API_URL.loginURL + "home/index/qrcode?url=" + encodeURIComponent(API_URL.WXUrlDetail + '/' + TV.GetParam('id'))
            // $('.erweimas').attr('src', surl)
        })
    }
    getMessage();


    function direOpt(index, directive) {
        if (directive == "up") { //上

            console.log('toptop')

            if (index == 1) { //文章翻滚
                TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
            }
        } else if (directive == "down") { //下

            if (index == 1) { //文章翻滚
                console.log(directive, modelIndex.thisContain, modelIndex.thisDetail, '21212')
                TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
            }
        } else if (directive == "backwards") { //左
            clearInterval(articleRun)

            switch (index) {
                case 1:
                    index = 3
                    break
                case 3:


                    index = 2
                    break;

            }

        } else if (directive == "forwards") {
            clearInterval(articleRun)

            switch (index) {

                case 2:
                    index = 3
                    break
                case 3:

                    index = 1
                    break;
            }
        }
        console.log(index)
        return index;
    }

    function direEnter(index) {
        console.log(index)
        if (index == 0) {} else if (index == 1) { //点单预约
        } else if (index == 2) {
            var params = {
                id: TV.GetParam('id'),
                name: EVM.cookie.getValue('TV_CST_NAME'),
                mobile: EVM.cookie.getValue('TV_CST_MOBILE'),
            }
            GetDatas('articleLike', params, function(err, res) {
                resOpt.call(this, res)
            });
        }
    }

    function resOpt(res) {
        if (res.code == 0) {
            TV.PromptMsg("点赞成功");
            $("#likes p").html(res.data.likes)

        } else if (res.code == 10002) {
            TV.userLogin();
            direEnter(index);
        } else {
            TV.PromptMsg(res.message)
        }
    }
</script>

</html>